import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';

import {AppComponent} from './app.component';
import {NZ_I18N} from 'ng-zorro-antd/i18n';
import {zh_CN} from 'ng-zorro-antd/i18n';
import {registerLocaleData} from '@angular/common';
import zh from '@angular/common/locales/zh';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {NzSpinModule} from 'ng-zorro-antd/spin';
import {NzModalModule} from 'ng-zorro-antd/modal';
import {NzIconModule} from 'ng-zorro-antd/icon';

import {LoadingModel} from '@shared-services/loading';
import {AppRoutingModule} from './app-routing.module';
import {AuthGuard, AuthInterceptor} from '@shared-services/auth';
import {IMqttServiceOptions, MqttModule} from 'ngx-mqtt';
import {environment} from '@environments';
import {HttpClientInMemoryWebApiModule} from 'angular-in-memory-web-api';
import {InMemoryDataService} from './in-memory-data.service';
import {NgxEchartsModule} from 'ngx-echarts';


registerLocaleData(zh);

export const MQTT_SERVICE_OPTIONS: IMqttServiceOptions = {
  hostname: environment.activemqServer,
  port: 61614,
  path: '/mqtt'
};

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    AppRoutingModule,
    NzSpinModule,
    NzModalModule,
    NzIconModule,
    LoadingModel.forRoot(),
    MqttModule.forRoot(MQTT_SERVICE_OPTIONS)
  ],
  providers: [
    AuthGuard,
    {provide: NZ_I18N, useValue: zh_CN},
    {provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true},

  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}
